<?php
/*
 * This class is called mpage due to the __autoload .
 * 
 * @autor : Javier Camelis
 * */

class mpage extends Module 
{
	
  private $_fields    = Array() ;
  
  public $_table_name  = 'page' ;
  public $_module_id   = 4 ;
  public $_pk_name     = 'article_id' ;
	
	function __construct()
	{
//		debug::pr('aca') ;
		return $this ;
	}
  function _read_simple( $params = Array() )
  {
    return $this ;
  }
	function _read_multiple( $params = Array() )
	{
		global $db ;
		$sql = " SELECT * FROM {prefix}page ; " ;
//		debug::pr($sql) ;
		$this->_elements = $db->query($sql,false) ;
//		debug::pr($this->_elements) ;
    return $this ;
	}
	function _read_form( $params = Array() )
	{
		$form = new form($this->_module_id) ;
		$this->_fields = $form->get_Elements() ;
	}
  function get_Fields()
  {
    return $this->_fields ;
  }
  function _read_update_form( $params = Array() )
  {
    $this->_read_form( $params )
         ->_read_simple( $params )
         ->_fill_form_data( $params ) ;
  }
  /*
   * private function _fill_form_data()
   * this function merge the form fields ($this->_fields) with the corresponding content data ($this->_elements[0] )
   */
  private function _fill_form_data()
  {
    return $this ;
  }
}